<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>前端面试题(html,http) | Will&#39;s blog</title>
    <meta name="generator" content="VuePress 1.5.4">
    <link rel="icon" href="/will/xin.ico">
    <link rel="stylesheet" href="../style/main.css">
    <meta name="description" content="斯人若彩虹，遇上方知有">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    <link rel="preload" href="/will/assets/css/0.styles.b6de8ef8.css" as="style"><link rel="preload" href="/will/assets/js/app.e77fe8ad.js" as="script"><link rel="preload" href="/will/assets/js/3.19d8dd7e.js" as="script"><link rel="preload" href="/will/assets/js/1.cde8b311.js" as="script"><link rel="preload" href="/will/assets/js/23.fe130883.js" as="script"><link rel="prefetch" href="/will/assets/js/10.3f6ba718.js"><link rel="prefetch" href="/will/assets/js/100.139e2315.js"><link rel="prefetch" href="/will/assets/js/101.48688945.js"><link rel="prefetch" href="/will/assets/js/102.065adb71.js"><link rel="prefetch" href="/will/assets/js/103.afb27929.js"><link rel="prefetch" href="/will/assets/js/104.d56b5577.js"><link rel="prefetch" href="/will/assets/js/105.8e6de207.js"><link rel="prefetch" href="/will/assets/js/106.cf8275a7.js"><link rel="prefetch" href="/will/assets/js/107.e1219958.js"><link rel="prefetch" href="/will/assets/js/108.89f471cb.js"><link rel="prefetch" href="/will/assets/js/109.860a4646.js"><link rel="prefetch" href="/will/assets/js/11.48a3ea24.js"><link rel="prefetch" href="/will/assets/js/110.4c49a0f9.js"><link rel="prefetch" href="/will/assets/js/111.b1ff0a30.js"><link rel="prefetch" href="/will/assets/js/112.6855af7b.js"><link rel="prefetch" href="/will/assets/js/113.73cc10ce.js"><link rel="prefetch" href="/will/assets/js/114.d9f95ccf.js"><link rel="prefetch" href="/will/assets/js/115.c204c90d.js"><link rel="prefetch" href="/will/assets/js/116.b6786151.js"><link rel="prefetch" href="/will/assets/js/117.c980193e.js"><link rel="prefetch" href="/will/assets/js/118.fd5f5951.js"><link rel="prefetch" href="/will/assets/js/119.2d749326.js"><link rel="prefetch" href="/will/assets/js/12.dd541a6f.js"><link rel="prefetch" href="/will/assets/js/120.c895e973.js"><link rel="prefetch" href="/will/assets/js/121.16eebc81.js"><link rel="prefetch" href="/will/assets/js/122.998e4582.js"><link rel="prefetch" href="/will/assets/js/123.487162ff.js"><link rel="prefetch" href="/will/assets/js/124.c6da26b1.js"><link rel="prefetch" href="/will/assets/js/125.4a263c66.js"><link rel="prefetch" href="/will/assets/js/126.0dc9a457.js"><link rel="prefetch" href="/will/assets/js/127.3f9cf0a9.js"><link rel="prefetch" href="/will/assets/js/128.f1b86c76.js"><link rel="prefetch" href="/will/assets/js/129.ba20315e.js"><link rel="prefetch" href="/will/assets/js/13.42b44cbf.js"><link rel="prefetch" href="/will/assets/js/130.0aa34e0b.js"><link rel="prefetch" href="/will/assets/js/131.fee81874.js"><link rel="prefetch" href="/will/assets/js/132.184d555a.js"><link rel="prefetch" href="/will/assets/js/133.15287e42.js"><link rel="prefetch" href="/will/assets/js/134.abe85c40.js"><link rel="prefetch" href="/will/assets/js/135.9ea3de85.js"><link rel="prefetch" href="/will/assets/js/136.b78a6ff1.js"><link rel="prefetch" href="/will/assets/js/137.a43d0025.js"><link rel="prefetch" href="/will/assets/js/138.19f94f16.js"><link rel="prefetch" href="/will/assets/js/139.64e33006.js"><link rel="prefetch" href="/will/assets/js/14.a6795e27.js"><link rel="prefetch" href="/will/assets/js/140.715ecf96.js"><link rel="prefetch" href="/will/assets/js/141.1ba53cc8.js"><link rel="prefetch" href="/will/assets/js/142.c524ce74.js"><link rel="prefetch" href="/will/assets/js/143.663d8f77.js"><link rel="prefetch" href="/will/assets/js/15.57ade25d.js"><link rel="prefetch" href="/will/assets/js/16.ea3d25d9.js"><link rel="prefetch" href="/will/assets/js/17.227b5567.js"><link rel="prefetch" href="/will/assets/js/18.798dabbc.js"><link rel="prefetch" href="/will/assets/js/19.92a956d1.js"><link rel="prefetch" href="/will/assets/js/20.58156a8f.js"><link rel="prefetch" href="/will/assets/js/21.be577f23.js"><link rel="prefetch" href="/will/assets/js/22.da032112.js"><link rel="prefetch" href="/will/assets/js/24.73e19630.js"><link rel="prefetch" href="/will/assets/js/25.6e63b142.js"><link rel="prefetch" href="/will/assets/js/26.9ceb241f.js"><link rel="prefetch" href="/will/assets/js/27.a9b40edd.js"><link rel="prefetch" href="/will/assets/js/28.1898b904.js"><link rel="prefetch" href="/will/assets/js/29.f177f57a.js"><link rel="prefetch" href="/will/assets/js/30.119d11bc.js"><link rel="prefetch" href="/will/assets/js/31.2b5effe7.js"><link rel="prefetch" href="/will/assets/js/32.8f523225.js"><link rel="prefetch" href="/will/assets/js/33.bd743528.js"><link rel="prefetch" href="/will/assets/js/34.ebbfd9c7.js"><link rel="prefetch" href="/will/assets/js/35.fd8a4d41.js"><link rel="prefetch" href="/will/assets/js/36.7926ae95.js"><link rel="prefetch" href="/will/assets/js/37.d954ed43.js"><link rel="prefetch" href="/will/assets/js/38.ad4f1845.js"><link rel="prefetch" href="/will/assets/js/39.b08e799e.js"><link rel="prefetch" href="/will/assets/js/4.3889049d.js"><link rel="prefetch" href="/will/assets/js/40.f679097f.js"><link rel="prefetch" href="/will/assets/js/41.0399d427.js"><link rel="prefetch" href="/will/assets/js/42.8406af0a.js"><link rel="prefetch" href="/will/assets/js/43.81fbaed1.js"><link rel="prefetch" href="/will/assets/js/44.37da88a9.js"><link rel="prefetch" href="/will/assets/js/45.13ecbc23.js"><link rel="prefetch" href="/will/assets/js/46.c7219a20.js"><link rel="prefetch" href="/will/assets/js/47.582a1f3b.js"><link rel="prefetch" href="/will/assets/js/48.9582e48c.js"><link rel="prefetch" href="/will/assets/js/49.c4b6e61c.js"><link rel="prefetch" href="/will/assets/js/5.5225a481.js"><link rel="prefetch" href="/will/assets/js/50.1f4590f9.js"><link rel="prefetch" href="/will/assets/js/51.24b2997a.js"><link rel="prefetch" href="/will/assets/js/52.41560234.js"><link rel="prefetch" href="/will/assets/js/53.c187d861.js"><link rel="prefetch" href="/will/assets/js/54.f9228e97.js"><link rel="prefetch" href="/will/assets/js/55.a984b610.js"><link rel="prefetch" href="/will/assets/js/56.d4c315db.js"><link rel="prefetch" href="/will/assets/js/57.c53a2862.js"><link rel="prefetch" href="/will/assets/js/58.352c456f.js"><link rel="prefetch" href="/will/assets/js/59.8b4474e9.js"><link rel="prefetch" href="/will/assets/js/6.dabd5d34.js"><link rel="prefetch" href="/will/assets/js/60.7b0b22d1.js"><link rel="prefetch" href="/will/assets/js/61.c71acc1d.js"><link rel="prefetch" href="/will/assets/js/62.1e574112.js"><link rel="prefetch" href="/will/assets/js/63.e4a3ed80.js"><link rel="prefetch" href="/will/assets/js/64.8f0b32d3.js"><link rel="prefetch" href="/will/assets/js/65.b26a8612.js"><link rel="prefetch" href="/will/assets/js/66.6c1d63a4.js"><link rel="prefetch" href="/will/assets/js/67.b4373b3a.js"><link rel="prefetch" href="/will/assets/js/68.aa860531.js"><link rel="prefetch" href="/will/assets/js/69.48e4f511.js"><link rel="prefetch" href="/will/assets/js/7.659833f2.js"><link rel="prefetch" href="/will/assets/js/70.af7808fd.js"><link rel="prefetch" href="/will/assets/js/71.fa9ce741.js"><link rel="prefetch" href="/will/assets/js/72.e3cd206c.js"><link rel="prefetch" href="/will/assets/js/73.243cf46e.js"><link rel="prefetch" href="/will/assets/js/74.7cdb1f58.js"><link rel="prefetch" href="/will/assets/js/75.f22a8f44.js"><link rel="prefetch" href="/will/assets/js/76.05829c26.js"><link rel="prefetch" href="/will/assets/js/77.ce58ae8c.js"><link rel="prefetch" href="/will/assets/js/78.84c26697.js"><link rel="prefetch" href="/will/assets/js/79.e32dd7dd.js"><link rel="prefetch" href="/will/assets/js/8.f1a7e839.js"><link rel="prefetch" href="/will/assets/js/80.490f4009.js"><link rel="prefetch" href="/will/assets/js/81.96af5f79.js"><link rel="prefetch" href="/will/assets/js/82.719eb3e4.js"><link rel="prefetch" href="/will/assets/js/83.5ac308b4.js"><link rel="prefetch" href="/will/assets/js/84.e7a6be4a.js"><link rel="prefetch" href="/will/assets/js/85.943e06e1.js"><link rel="prefetch" href="/will/assets/js/86.9d30362b.js"><link rel="prefetch" href="/will/assets/js/87.74d9d285.js"><link rel="prefetch" href="/will/assets/js/88.c2fe652b.js"><link rel="prefetch" href="/will/assets/js/89.e879f671.js"><link rel="prefetch" href="/will/assets/js/9.c8e9dac1.js"><link rel="prefetch" href="/will/assets/js/90.5569b937.js"><link rel="prefetch" href="/will/assets/js/91.47320865.js"><link rel="prefetch" href="/will/assets/js/92.317dd9ba.js"><link rel="prefetch" href="/will/assets/js/93.26d10883.js"><link rel="prefetch" href="/will/assets/js/94.ba199252.js"><link rel="prefetch" href="/will/assets/js/95.4ce3b46e.js"><link rel="prefetch" href="/will/assets/js/96.d71e1886.js"><link rel="prefetch" href="/will/assets/js/97.a42a98b8.js"><link rel="prefetch" href="/will/assets/js/98.cf22a42b.js"><link rel="prefetch" href="/will/assets/js/99.f6738a3e.js">
    <link rel="stylesheet" href="/will/assets/css/0.styles.b6de8ef8.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container no-sidebar" data-v-2d5f533b><div data-v-2d5f533b><div id="loader-wrapper" class="loading-wrapper" data-v-d48f4d20 data-v-2d5f533b data-v-2d5f533b><div class="loader-main" data-v-d48f4d20><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div></div> <!----> <!----></div> <div class="password-shadow password-wrapper-out" style="display:none;" data-v-64685f0e data-v-2d5f533b data-v-2d5f533b><h3 class="title" style="display:none;" data-v-64685f0e data-v-64685f0e>Will's blog</h3> <!----> <label id="box" class="inputBox" style="display:none;" data-v-64685f0e data-v-64685f0e><input type="password" value="" data-v-64685f0e> <span data-v-64685f0e>Konck! Knock!</span> <button data-v-64685f0e>OK</button></label> <div class="footer" style="display:none;" data-v-64685f0e data-v-64685f0e><span data-v-64685f0e><i class="iconfont reco-theme" data-v-64685f0e></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-64685f0e>vuePress-theme-reco</a></span> <span data-v-64685f0e><i class="iconfont reco-copyright" data-v-64685f0e></i> <a data-v-64685f0e><span data-v-64685f0e>Will</span>
            
          <span data-v-64685f0e>2020 - </span>
          2023
        </a></span></div></div> <div class="hide" data-v-2d5f533b><header class="navbar" data-v-2d5f533b><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/will/" class="home-link router-link-active"><img src="/will/xin.png" alt="Will's blog" class="logo"> <span class="site-name">Will's blog</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/will/" class="nav-link"><i class="iconfont reco-home"></i>
  主页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-coding"></i>
      前端
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/will/docs/note/" class="nav-link"><i class="iconfont reco-suggestion"></i>
  学习笔记
</a></li><li class="dropdown-item"><!----> <a href="/will/docs/books/" class="nav-link"><i class="iconfont reco-npm"></i>
  阅读书籍
</a></li><li class="dropdown-item"><!----> <a href="/will/docs/article/" class="nav-link"><i class="iconfont reco-api"></i>
  质量文章
</a></li><li class="dropdown-item"><!----> <a href="/will/docs/dailyNotes/" class="nav-link"><i class="iconfont reco-suggestion"></i>
  日常笔记
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/will/categories/Vue/" class="nav-link"><i class="iconfont undefined"></i>
  Vue
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/规范编码/" class="nav-link"><i class="iconfont undefined"></i>
  规范编码
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/项目总结/" class="nav-link"><i class="iconfont undefined"></i>
  项目总结
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/Vue组件/" class="nav-link"><i class="iconfont undefined"></i>
  Vue组件
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/javaScript/" class="nav-link"><i class="iconfont undefined"></i>
  javaScript
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/工具js库/" class="nav-link"><i class="iconfont undefined"></i>
  工具js库
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/vue/" class="nav-link"><i class="iconfont undefined"></i>
  vue
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/组件/" class="nav-link"><i class="iconfont undefined"></i>
  组件
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/TypeScript/" class="nav-link"><i class="iconfont undefined"></i>
  TypeScript
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/基础知识/" class="nav-link"><i class="iconfont undefined"></i>
  基础知识
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/总结/" class="nav-link"><i class="iconfont undefined"></i>
  总结
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/日常笔记/" class="nav-link"><i class="iconfont undefined"></i>
  日常笔记
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/学习计划/" class="nav-link"><i class="iconfont undefined"></i>
  学习计划
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/css/" class="nav-link"><i class="iconfont undefined"></i>
  css
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/element/" class="nav-link"><i class="iconfont undefined"></i>
  element
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/其他/" class="nav-link"><i class="iconfont undefined"></i>
  其他
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/Vue3/" class="nav-link"><i class="iconfont undefined"></i>
  Vue3
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/数据可视化/" class="nav-link"><i class="iconfont undefined"></i>
  数据可视化
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/算法/" class="nav-link"><i class="iconfont undefined"></i>
  算法
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/面试/" class="nav-link"><i class="iconfont undefined"></i>
  面试
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/Vite/" class="nav-link"><i class="iconfont undefined"></i>
  Vite
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/uni-app/" class="nav-link"><i class="iconfont undefined"></i>
  uni-app
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/ui框架/" class="nav-link"><i class="iconfont undefined"></i>
  ui框架
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/小程序/" class="nav-link"><i class="iconfont undefined"></i>
  小程序
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/HTML/" class="nav-link"><i class="iconfont undefined"></i>
  HTML
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/CSS/" class="nav-link"><i class="iconfont undefined"></i>
  CSS
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/React.js/" class="nav-link"><i class="iconfont undefined"></i>
  React.js
</a></li></ul></div></div><div class="nav-item"><a href="/will/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      部分项目
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://github.com/zhenzhencai/FontEndInterview" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  面试指南
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="/will/docs/protests/VueUI.html" class="nav-link"><i class="iconfont reco-github"></i>
  Vue轮子
</a></li></ul></div></div><div class="nav-item"><a href="/will/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间线
</a></div><div class="nav-item"><a href="/will/docs/disorder/m1.html" class="nav-link"><i class="iconfont reco-coding"></i>
  题目汇总
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      关于我
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://gitee.com/willwong" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-mayun"></i>
  Gitee
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://github.com/wangliangxin" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=1418580404&amp;site=qq&amp;menu=yes" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-qq"></i>
  QQ
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-2d5f533b></div> <aside class="sidebar" data-v-2d5f533b><div class="personal-info-wrapper" data-v-ca798c94 data-v-2d5f533b><img src="/will/xin.png" alt="author-avatar" class="personal-img" data-v-ca798c94> <h3 class="name" data-v-ca798c94>
    Will
  </h3> <div class="num" data-v-ca798c94><div data-v-ca798c94><h3 data-v-ca798c94>85</h3> <h6 data-v-ca798c94>Article</h6></div> <div data-v-ca798c94><h3 data-v-ca798c94>6</h3> <h6 data-v-ca798c94>Tag</h6></div></div> <hr data-v-ca798c94></div> <nav class="nav-links"><div class="nav-item"><a href="/will/" class="nav-link"><i class="iconfont reco-home"></i>
  主页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-coding"></i>
      前端
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/will/docs/note/" class="nav-link"><i class="iconfont reco-suggestion"></i>
  学习笔记
</a></li><li class="dropdown-item"><!----> <a href="/will/docs/books/" class="nav-link"><i class="iconfont reco-npm"></i>
  阅读书籍
</a></li><li class="dropdown-item"><!----> <a href="/will/docs/article/" class="nav-link"><i class="iconfont reco-api"></i>
  质量文章
</a></li><li class="dropdown-item"><!----> <a href="/will/docs/dailyNotes/" class="nav-link"><i class="iconfont reco-suggestion"></i>
  日常笔记
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/will/categories/Vue/" class="nav-link"><i class="iconfont undefined"></i>
  Vue
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/规范编码/" class="nav-link"><i class="iconfont undefined"></i>
  规范编码
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/项目总结/" class="nav-link"><i class="iconfont undefined"></i>
  项目总结
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/Vue组件/" class="nav-link"><i class="iconfont undefined"></i>
  Vue组件
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/javaScript/" class="nav-link"><i class="iconfont undefined"></i>
  javaScript
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/工具js库/" class="nav-link"><i class="iconfont undefined"></i>
  工具js库
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/vue/" class="nav-link"><i class="iconfont undefined"></i>
  vue
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/组件/" class="nav-link"><i class="iconfont undefined"></i>
  组件
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/TypeScript/" class="nav-link"><i class="iconfont undefined"></i>
  TypeScript
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/基础知识/" class="nav-link"><i class="iconfont undefined"></i>
  基础知识
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/总结/" class="nav-link"><i class="iconfont undefined"></i>
  总结
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/日常笔记/" class="nav-link"><i class="iconfont undefined"></i>
  日常笔记
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/学习计划/" class="nav-link"><i class="iconfont undefined"></i>
  学习计划
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/css/" class="nav-link"><i class="iconfont undefined"></i>
  css
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/element/" class="nav-link"><i class="iconfont undefined"></i>
  element
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/其他/" class="nav-link"><i class="iconfont undefined"></i>
  其他
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/Vue3/" class="nav-link"><i class="iconfont undefined"></i>
  Vue3
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/数据可视化/" class="nav-link"><i class="iconfont undefined"></i>
  数据可视化
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/算法/" class="nav-link"><i class="iconfont undefined"></i>
  算法
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/面试/" class="nav-link"><i class="iconfont undefined"></i>
  面试
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/Vite/" class="nav-link"><i class="iconfont undefined"></i>
  Vite
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/uni-app/" class="nav-link"><i class="iconfont undefined"></i>
  uni-app
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/ui框架/" class="nav-link"><i class="iconfont undefined"></i>
  ui框架
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/小程序/" class="nav-link"><i class="iconfont undefined"></i>
  小程序
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/HTML/" class="nav-link"><i class="iconfont undefined"></i>
  HTML
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/CSS/" class="nav-link"><i class="iconfont undefined"></i>
  CSS
</a></li><li class="dropdown-item"><!----> <a href="/will/categories/React.js/" class="nav-link"><i class="iconfont undefined"></i>
  React.js
</a></li></ul></div></div><div class="nav-item"><a href="/will/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      部分项目
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://github.com/zhenzhencai/FontEndInterview" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  面试指南
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="/will/docs/protests/VueUI.html" class="nav-link"><i class="iconfont reco-github"></i>
  Vue轮子
</a></li></ul></div></div><div class="nav-item"><a href="/will/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间线
</a></div><div class="nav-item"><a href="/will/docs/disorder/m1.html" class="nav-link"><i class="iconfont reco-coding"></i>
  题目汇总
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      关于我
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://gitee.com/willwong" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-mayun"></i>
  Gitee
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://github.com/wangliangxin" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=1418580404&amp;site=qq&amp;menu=yes" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-qq"></i>
  QQ
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <!----> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-64685f0e data-v-2d5f533b><h3 class="title" style="display:none;" data-v-64685f0e data-v-64685f0e>前端面试题(html,http)</h3> <!----> <label id="box" class="inputBox" style="display:none;" data-v-64685f0e data-v-64685f0e><input type="password" value="" data-v-64685f0e> <span data-v-64685f0e>Konck! Knock!</span> <button data-v-64685f0e>OK</button></label> <div class="footer" style="display:none;" data-v-64685f0e data-v-64685f0e><span data-v-64685f0e><i class="iconfont reco-theme" data-v-64685f0e></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-64685f0e>vuePress-theme-reco</a></span> <span data-v-64685f0e><i class="iconfont reco-copyright" data-v-64685f0e></i> <a data-v-64685f0e><span data-v-64685f0e>Will</span>
            
          <span data-v-64685f0e>2020 - </span>
          2023
        </a></span></div></div> <div data-v-2d5f533b><main class="page"><div class="page-title" style="display:none;"><h1 class="title">前端面试题(html,http)</h1> <div data-v-3b7f5bdf><i class="iconfont reco-account" data-v-3b7f5bdf><span data-v-3b7f5bdf>Will</span></i> <i class="iconfont reco-date" data-v-3b7f5bdf><span data-v-3b7f5bdf>2021-01-01</span></i> <!----> <!----></div></div> <div class="theme-reco-content content__default" style="display:none;"><div id="boxx" data-v-f4ca0dac><div data-v-f4ca0dac><p v-if="true" class="custom-block-title" data-v-f4ca0dac></p> <p v-if="true" data-v-f4ca0dac></p></div></div> <p>推荐阅读：<br>
1，<a href="https://yangchaoyi.vip/posts/vue-family/" target="_blank" rel="noopener noreferrer">超逸の博客<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <h2 id="页面布局"><a href="#页面布局" class="header-anchor">#</a> 页面布局</h2> <p>题目： 假设高度已知，请写出三栏布局，其中左、右栏宽度各为300px，中间自适应</p> <ul><li>浮动解决方式</li> <li>绝对定位</li> <li>flexbox 解决方式，  <a href="http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html?utm_source=tuicool" target="_blank" rel="noopener noreferrer">flex 布局<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li>表格布局</li> <li>网格布局</li></ul> <p>🐬 <strong>优缺点</strong></p> <ul><li>浮动</li></ul> <blockquote><p>优点：兼容性比较好</p></blockquote> <blockquote><p>缺点：设置浮动之后，脱离了文档流，（需要清除浮动和其它浮动周边元素的关系处理好）处理不好的话，会带来很多问题，这是它本身的局限性。</p></blockquote> <ul><li>绝对定位</li></ul> <blockquote><p>优点: 快捷，不容易出问题</p></blockquote> <blockquote><p>缺点：本身脱离了文档流，就会导致子元素跟着脱离文档流。因此，导致绝对定位的有效性、可使用性比较差。</p></blockquote> <ul><li>flexbox</li></ul> <blockquote><p>css3中推出的flex布局，就是为了解决上述两种方式不足而出现的，算是比较完美的一种方式，尤其是对于移动端</p></blockquote> <ul><li>table</li></ul> <blockquote><p>优点: 尽管多数人吐槽表格布局，但其实，表格布局在很多场景都适用的。比如上文写的三栏布局设计当中，表格布局是不是很轻松就实现了呢？同时，表格布局的兼容性是非常好的，当用flex解决不了问题的时候，对于PC端 IE8是不支持flex的，此时就可以尝试表格布局</p></blockquote> <blockquote><p>缺点: 除开历史上一些诟病外，还有一个：比如我们把三栏理解成为三个小单元格，那么当其中某一个单元格高度超出的时候，其余两侧也会跟着调整，于是对于有些场景是不合适的。因此，对于不同场景，我们可以在flex和表格布局进行选优操作</p></blockquote> <h2 id="http"><a href="#http" class="header-anchor">#</a> HTTP</h2> <div class="language- line-numbers-mode"><pre class="language-text"><code>POST和GET的区别（重点前5条）
get在浏览器回退时是无害的，而post会再次提交请求

get请求会被浏览器主动缓存，而post不会，除非手动设置

get请求参数会被完整保留在浏览器历史记录里，而post中的参数不会被保留

get请求在URL中传送的参数是有长度限制的，而POST没有限制

get参数通过URL传递，post放在Request body中

get请求只能进行url编码，而post支持多种编码方式

对参数的数据类型，get只接受ASCALL字符，而post没有限制

get比post更不安全，因为参数直接暴露在URL上，所以不能用来传递敏感信息

get产生的URL地址可以被收藏，而post不可以

</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br></div></div><h2 id="浏览器的渲染机制"><a href="#浏览器的渲染机制" class="header-anchor">#</a> 浏览器的渲染机制</h2> <p>在浏览器的输入栏输入url到你看见的网页，是个怎样的过程？</p> <p>🍓 一共可分为下面几步：</p> <ul><li>DNS 解析</li> <li>TCP 连接</li> <li>发送HTTP 请求</li> <li>服务器处理请求并返回HTTP报文</li> <li>浏览器解析渲染页面</li> <li>连接结束</li></ul> <h4 id="具体过程"><a href="#具体过程" class="header-anchor">#</a> 具体过程</h4> <p>1，DNS 解析<br>
DNS解析，就是<strong>ip地址解析</strong>，（例如将www.google.com 解析成 64.233.189.104），就是寻找哪台机器上有你需要资源的过程。
当你在浏览器中输入一个地址时，例如www.baidu.com，其实不是百度网站真正意义上的地址。互联网上每一台计算机的唯一标识是它的IP地址，但是IP地址并不方便记忆。用户更喜欢用方便记忆的网址去寻找互联网上的其它计算机，也就是上面提到的百度的网址。所以互联网设计者需要在用户的方便性与可用性方面做一个权衡，这个权衡就是一个网址到IP地址的转换，这个过程就是DNS解析。它实际上充当了一个翻译的角色，实现了网址到IP地址的转换。</p> <p>DNS 的解析是一个<strong>递归查询的过程</strong>， 举个例子,🌰 查找www.google.com的IP地址过程。首先在本地域名服务器中查询IP地址，如果没有找到的情况下，本地域名服务器会向根域名服务器发送一个请求，如果根域名服务器也不存在该域名时，本地域名会向com顶级域名服务器发送一个请求，……， 解析过程为: . -&gt; .com -&gt; google.com. -&gt; www.google.com.。</p> <p>🐬 拓展<br>
DNS 缓存： DNS存在着多级缓存，从离浏览器的距离排序的话，有以下几种: 浏览器缓存，系统缓存，路由器缓存，IPS服务器缓存，根域名服务器缓存，顶级域名服务器缓存，主域名服务器缓存。（例如：系统缓存主要存在/etc/hosts）， 这样的话就不需要经历上面的所有查询过程</p> <p>DNS 负载均衡：不知道大家有没有思考过一个问题: DNS返回的IP地址是否每次都一样？<br>
如果每次都一样是否说明你请求的资源都位于同一台机器上面，那么这台机器需要多高的性能和储存才能满足亿万请求呢？其实真实的互联网世界背后存在成千上百台服务器，大型的网站甚至更多。但是在用户的眼中，它需要的只是处理他的请求，哪台机器处理请求并不重要。DNS可以返回一个合适的机器的IP给用户，例如可以根据每台机器的负载量，该机器离用户地理位置的距离等等，这种过程就是DNS负载均衡</p> <p>DNS 重定向：也就是DNS负载均衡，大家耳熟能详的CDN(Content Delivery Network)就是利用DNS的重定向技术，DNS服务器会返回一个跟用户最接近的点的IP地址给用户，CDN节点的服务器负责响应用户的请求，提供所需的内容。</p> <hr> <p>2，TCP 连接(三次握手,四次挥手)<br> <a href="https://www.jianshu.com/p/d3725391af59" target="_blank" rel="noopener noreferrer">简单理解<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a><br>
什么是TCP连接？为什么要TCP连接？</p> <blockquote><p>为实现数据的可靠传输，TCP要在应用进程间建立传输连接。它是在两个传输用户之间建立一种逻辑联系，使得通信双方都确认对方为自己的传输连接端点。</p></blockquote> <p>通俗理解：<br>
三次握手：<br>
1，clint： 服务器啊，我是客户端，你能听见我说话吗？  （证明客户端能发送数据）<br>
2，server：客户端啊，我收到了。  （证明客户端能接收数据，发送数据）<br>
3，client：服务器啊，我收到了你的消息，下面我们可以互相发数据了。（证明客户端能接收数据）</p> <p>四次挥手：<br>
1）Client：我所有东西都说完了<br>
2）Server：我已经全部听到了，但是等等我，我还没说完<br>
3）Server：好了，我已经说完了<br>
4）Client：好的，我接收完了，那我们的通信结束l</p> <hr> <p>3，发送HTTP 请求<br>
发送HTTP请求的过程就是构建HTTP请求报文并通过TCP协议中发送到服务器指定端口</p> <p>http 与 https：<br>
HTTPS协议的本质就是HTTP + SSL(or TLS)。在HTTP报文进入TCP报文之前，先使用SSL对HTTP报文进行加密。</p> <p><img src="/will/assets/img/31.69a38734.png" alt="xx"></p> <p>HTTP请求报文是由三部分组成: 请求行, 请求报头和请求正文。（在网页中发f12中的network查看请求的报文）</p> <ul><li>请求行</li></ul> <div class="language- line-numbers-mode"><pre class="language-text"><code>Method Request-URL HTTP-Version CRLF
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>常见的method： GET, POST, PUT, DELETE, OPTIONS, HEAD。</p> <details class="custom-block details"><summary>GET 和 POST 的区别</summary> <p>GET请求在URL中传送的参数是有长度限制的，而POST没有。</p> <p>GET比POST更不安全，因为参数直接暴露在URL上，所以不能用来传递敏感信息。</p> <p>GET参数通过URL传递，POST放在Request body中。</p> <p>GET请求参数会被完整保留在浏览器历史记录里，而POST中的参数不会被保留。</p> <p>GET请求只能进行url编码，而POST支持多种编码方式。</p> <p>GET请求会被浏览器主动cache，而POST不会，除非手动设置。</p> <p>GET产生的URL地址可以被Bookmark，而POST不可以。</p> <p>GET在浏览器回退时是无害的，而POST会再次提交请求。</p></details> <hr> <p>4，服务处理请求并返回http报文
HTTP响应报文也是由三部分组成: 状态码, 响应报头和响应报文。<br>
常见的状态码：<br>
1xx：指示信息——表示请求已接收，继续处理<br>
2xx：成功——表示请求已经被成功接收<br>
3xx：重定向——要完成请求必须进行更进一步的操作<br>
4xx：客户端错误——请求有语法错误或请求无法实现<br>
5xx：服务器错误——服务器未能实现合法的请求</p> <p>200 OK：客户端请求成功<br>
206 Partial Content：客户发送了一个带有Range（范围）头的GET请求，服务器完成了它（比如客户端请求0-1w字节，服务器就会返回206,常见播放视频和音频地址，文件过大时一般返回206）</p> <hr> <p>301 Moved Permanently：所请求的页面已经转移至新的URL<br>
302 Found：所请求的页面已经临时转移至新的URL<br>
304 Not Modified：客户端有缓冲的文档并发出一个条件性的请求，服务器告诉客户，原来缓冲的文档还可以继续使用</p> <hr> <p>400 Bad Request：客户端请求有语法错误，不能被服务器所理解<br>
401 Unauthorized：请求未经授权，这个状态码必须和WWW-Authenticate报头域一起使用<br>
403 Forbidden：请求访问的页面被禁止（比如页面只能通过服务端去访问）<br>
404 Not Found：请求资源不存在</p> <hr> <p>500 Internal Server Error：服务器发生不可预料的错误但原来缓冲的文档还可以继续使用<br>
503 Server Unavailable：请求未完成，服务器临时过载或当机，一段时候后可能恢复正常</p> <p>响应报文：服务器返回给浏览器的文本信息，通常HTML, CSS, JS, 图片等文件就放在这一部分。</p> <hr> <p>5， 浏览器渲染页面</p> <p><img src="/will/assets/img/32.67a3bc4a.png" alt=""></p> <p>第一步，HTML经过HTML解析器解析成为DOM Tree</p> <p>第二步，CSS通过CSS解析器形成样式规则</p> <p>第三步，将两个DOM结合形成Render Tree(渲染树)，这里就类似于告诉浏览器渲染树结构基本出来了，此时有一个平行操作，Layout，经过这个，就能知道元素具体应该显示在屏幕在哪个位置（宽、高、颜色等）</p> <p>最后一步，浏览器通过GUI画图，呈现页面内容，最后Display显示页面</p> <details class="custom-block details"><summary>reflow(回流) 和 repaint(重绘)</summary> <p>当render tree的一部分或者全部元素因改变了自身的宽高，布局，显示或隐藏，或元素内部的文字结构发生变化，导致需要重新构建页面的时候，回流就产生了.</p> <p>当一个元素自身的宽高，布局，及显示或隐藏没有改变，而只是改变了元素的外观风格的时候，就产生了重绘。</p> <p>回流必定触发重绘，而重绘不一定出发回流</p></details> <p>🐟 js解析<br>
js 的解析是由浏览器中的js 解析引擎完成的，<strong>js 是单线程运行的</strong>， 也就是说，在同一个时间内只能做一件事情，所有的任务都需要排队
，前一个任务结束，后一个任务才开始。 但是很多任务是很耗时间的（比如下载文件），所以需要一种机制可以先执行排在后面的任务，这就是：同步任务(synchronous)和异步任务(asynchronous)。JS的执行机制就可以看做是一个主线程加上一个任务队列(task queue)。同步任务就是放在主线程上执行的任务，异步任务是放在任务队列中的任务。所有的同步任务在主线程上执行，形成一个执行栈;异步任务有了运行结果就会在任务队列中放置一个事件；脚本运行时先依次运行执行栈，然后会从任务队列里提取事件，运行任务队列中的任务，这个过程是不断重复的，所以又叫做事件循环(Event loop)。</p> <p>举个例子： 输出结果为 1,3,2,</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code>console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
<span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p>当文档加载过程中遇到JS文件，HTML文档会挂起渲染过程，不仅要等到文档中JS文件加载完毕还要等待解析执行完毕，才会继续HTML的渲染过程。原因是因为JS有可能修改DOM结构，这就意味着JS执行完成前，后续所有资源的下载是没有必要的，这就是JS阻塞后续资源下载的根本原因。CSS文件的加载不影响JS文件的加载，但是却影响JS文件的执行。JS代码执行前浏览器必须保证CSS文件已经下载并加载完毕。</p> <hr> <h2 id="网站优化"><a href="#网站优化" class="header-anchor">#</a> 网站优化</h2> <p>推荐阅读：<br>
1，<a href="https://blog.csdn.net/damys/article/details/11521809" target="_blank" rel="noopener noreferrer">雅虎WEB前端网站优化—34条军规<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <ul><li>减少http请求数</li> <li>利用CDN技术</li> <li>设置头文件过期或者静态缓存</li> <li>Gzip压缩</li> <li>把css放顶部</li> <li>把js放底部
……</li></ul> <p>提升页面性能的方法有哪些？<br>
1、资源压缩合并，减少HTTP请求<br>
2、非核心代码异步加载——异步加载的方式——异步加载的区别<br>
3、利用浏览器缓存——缓存的分类——缓存的原理<br>
4、使用CDN<br>
5、预解析DNS</p> <p>你知道浏览器与缓存相关的http头有哪些？</p> <ul><li>强缓存（不用任何请求，拿过来就用，如果两个都下发，以第二个Cache为准）</li></ul> <p><strong>Expires</strong>（过期时间-服务器绝对时间） Expires:Thu,21 Jan 2017 23:39:02 GMT
（会导致客户端时间和服务器时间之间时间差问题）
<strong>Cache-Control</strong>（客户端相对时间，单位秒） Cache-Control:max-age=3600</p> <ul><li>协商缓存（浏览器发现本地有这个副本，但是不确定用不用它，于是得向服务器问一下，这个副本要不要用）</li></ul> <p><strong>Last-Modified</strong>（拿到某个资源文件时，通过这个字段服务器下发一个时间）
<strong>If-Modified-Since</strong> （当下次请求这个资源是否发生变化时，是用这个key值，对比两个时间）</p> <p>Last-Modified: Web,26 Jan 2017 00:35:11 GMT</p> <p>（上述方式会存在问题，例如我可能时间上修改了，但是内容并没有修改）</p> <p><strong>Etage</strong>（解决上述问题，服务器给Etage值，当过了强缓存时间，浏览器请求是否可用副本时，会在http请求头中用 If-None-Match 当做key值，加上value，此value就是Etage的值）</p> <h2 id="html5-新特性"><a href="#html5-新特性" class="header-anchor">#</a> html5 新特性</h2> <p>html5 新特性，移除了哪些元素？<br>
说到 h5 当然要说到语义化标签啦，比如article、footer、header、nav、section<br>
绘画： canvas
媒体：video、audio
存储：localStorage（长期存储数据）、sessionStorage（页面关闭删除）
表单控件：calendar、date、time、email、url、search</p> <p>🦄 移除元素：<br>
纯表现的元素：basefont、big、center、font、 s、strike、tt、u<br>
对可用性产生负面影响的元素：frame、frameset、noframes</p> <hr> <p>🐬 <strong>请描述一下 cookies，sessionStorage 和 localStorage 的区别？</strong></p> <ul><li><p><code>cookie</code> 是网站为了标示用户身份而存储在用户本地终端（client Side）上的数据（例如： Token）</p></li> <li><p><code>cookie</code> 数据失踪在同源的http请求中携带，即使不需要，即会在浏览器和服务器来回传递</p></li> <li><p><code>sessionStrorage</code>和<code>localStorage</code>不会自动把数据发给服务器，仅保存在本地</p></li></ul> <p>存储大小：</p> <ul><li><code>cookie</code>数据大小不能超过 4k</li> <li><code>sessionStorage</code> 和<code>localStorage</code> 可以达到5M或者更大</li></ul> <p>有效时间：</p> <ul><li><code>localStorage</code> 存储持久数据，浏览器关闭后数据不会丢失，除非主动删除</li> <li><code>sessionStorage</code> 数据在当前浏览器窗口关闭后自动删除</li> <li><code>cookie</code> 在设置的 expires（过期时间）之前，一直有效，即使当前浏览器关闭</li></ul> <hr> <p>🐬 <strong>行内元素有哪些？块级元素有哪些？空（void）元素有哪些？</strong><br>
行内元素不可以设置宽高，不独占一行<br>
块级元素可以设置宽高，独占一行</p> <ul><li>🦄  行内</li></ul> <div class="language- line-numbers-mode"><pre class="language-text"><code>&lt;a&gt;、&lt;abbr&gt;、&lt;acronym&gt;、&lt;b&gt;、&lt;bdo&gt;、&lt;big&gt;、&lt;br&gt;、
&lt;cite&gt;、&lt;code&gt;、&lt;dfn&gt;、&lt;em&gt;、&lt;i&gt;、&lt;img&gt;、&lt;input&gt;、
&lt;kbd&gt;、&lt;label&gt;、&lt;q&gt;、&lt;samp&gt;、&lt;select&gt;、&lt;small&gt;、&lt;span&gt;、
&lt;strong&gt;、&lt;sub&gt;、&lt;sup&gt;、&lt;textarea&gt;、&lt;tt&gt;、&lt;var&gt;
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><ul><li>🦄  块级</li></ul> <div class="language- line-numbers-mode"><pre class="language-text"><code>&lt;address&gt;、&lt;caption&gt;、&lt;dd&gt;、&lt;div&gt;、&lt;dl&gt;、&lt;dt&gt;、&lt;fieldset&gt;、
&lt;form&gt;、&lt;h1&gt;、&lt;h2&gt;、&lt;h3&gt;、&lt;h4&gt;、&lt;h5&gt;、&lt;h6&gt;、&lt;hr&gt;、&lt;legend&gt;、
&lt;li&gt;、&lt;noframes&gt;、&lt;noscript&gt;、&lt;ol&gt;、&lt;ul&gt;、&lt;p&gt;、&lt;pre&gt;、&lt;table&gt;、
&lt;tbody&gt;、&lt;td&gt;、&lt;tfoot&gt;、&lt;th&gt;、&lt;thead&gt;、&lt;tr&gt;
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><hr></div> <footer class="page-edit" style="display:none;"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">7/27/2022, 8:13:22 PM</span></div></footer> <!----> <!----> <!----></main> <!----></div></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;display:none;" data-v-c6073ba8 data-v-c6073ba8><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-c6073ba8><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-c6073ba8></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-c6073ba8></path></svg></div><div class="kanbanniang" data-v-5775ee02><div class="banniang-container" style="display:;" data-v-5775ee02><div class="messageBox" style="right:68px;bottom:190px;display:none;" data-v-5775ee02>
      欢迎来到 Will's blog
    </div> <div class="operation" style="right:90px;bottom:40px;display:none;" data-v-5775ee02><i class="kbnfont kbn-ban-home ban-home" data-v-5775ee02></i> <i class="kbnfont kbn-ban-message message" data-v-5775ee02></i> <i class="kbnfont kbn-ban-close close" data-v-5775ee02></i> <a target="_blank" href="https://vuepress-theme-reco.recoluan.com/views/plugins/kanbanniang.html" data-v-5775ee02><i class="kbnfont kbn-ban-info info" data-v-5775ee02></i></a> <i class="kbnfont kbn-ban-theme skin" style="display:none;" data-v-5775ee02></i></div> <canvas id="banniang" width="150" height="220" class="live2d" style="right:90px;bottom:0px;opacity:1;" data-v-5775ee02></canvas></div> <div class="showBanNiang" style="display:none;" data-v-5775ee02>
    看板娘
  </div></div><div></div><canvas id="vuepress-canvas-cursor"></canvas></div></div>
    <script src="/will/assets/js/app.e77fe8ad.js" defer></script><script src="/will/assets/js/3.19d8dd7e.js" defer></script><script src="/will/assets/js/1.cde8b311.js" defer></script><script src="/will/assets/js/23.fe130883.js" defer></script>
  </body>
</html>
